import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/index',
    children:[
    ]
  },
  {
    path: '/counter',
    component: () => import('../views/CounterView.vue'),
    redirect: '/counter/machine',
    children: [
      {
        path: 'machine',
        component: () => import('../views/counter/MachineView.vue'),
      },
      {
        path: 'add',
        component: () => import('../views/counter/AddView.vue'),
      },
      {
        path: 'list',
        component: () => import('../views/counter/ListView.vue'),
      },
      {
        path: 'box',
        component: () => import('../views/counter/BoxView.vue'),
      },
      {
        path: 'update',
        component: () => import('../views/counter/UpdateView.vue'),
      },
      {
        path: 'detail',
        component: () => import('../views/counter/DetailView.vue'),
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
